<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8"/>
  <title>wysiwyg-sceditor</title>
  <script src="../../dist/jsoneditor.js"></script>
</head>
<body>
<h1>Test</h1>
<label for="value">value</label>
<textarea class="value" id="value" cols="30" rows="10"></textarea>
<button class='get-value'>Get Value</button>
<div class='container'></div>

<script>
  var container = document.querySelector('.container');
  var value = document.querySelector('.value');

  var schema = {
    "type": "object",
    "properties": {
      "boolean": {
        "type": "boolean",
        "title": "Boolean!",
        "default": true
      }
    }
  };

  var editor = new JSONEditor(container, {
    schema: schema
  });

  document.querySelector('.get-value').addEventListener('click', function () {
    value.value = JSON.stringify(editor.getValue());
    console.log(editor.getValue());
  });

</script>

</body>
</html>
